package apiDay02;

public class StringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder buf=new StringBuilder();
        buf.append("A")
                .append("A")//追加方法
                .append("A")
                .append("B")
                .append("B")
                .insert(1,"C")//插入方法
                .delete(2,4);//删除方法
        String str=buf.toString();
        System.out.println(buf);









        /*
        long t1=System.currentTimeMillis();
        for (int i = 0; i <50000 ; i++) {
            buf.append("A");
        }
        long t2=System.currentTimeMillis();
        System.out.println(t2-t1);

         */
    }
}
